<?php 
class Country_model extends Model {
	
	var $tbl_name = 'country';
	
	function Country_model() {
		parent::Model();
	}
	
	function addCountry($ary_info=array()) {
		$this->db->insert($this->tbl_name, $ary_info);
		
		return $this->db->insert_id();
	} 
	
	function getCountries($ary_info=array()) {
		$this->db->where($ary_info);
		
		$query = $this->db->get($this->tbl_name);
		if ($query->num_rows()>0) {
			return $query->result_array(); 
		}
	}
	
	function getCountry($ary_info=array()) {
		$this->db->where($ary_info);
		
		$query = $this->db->get($this->tbl_name);
		if ($query->num_rows()>0) {
			return $query->row_array(); 
		}
	}
}